<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>propety</title>
</head>
<body>
<script src="js/jquery-1.7.2.js"></script>
<script>
    function Cat(name,color){
        this.name = name;
        this.color = color;
    }

    Cat.prototype.type = 'cat is animal';
    Cat.prototype.eat = function(){console.log('eat mouse!');};

    var cat1 = new Cat('miao','yellow');
    var cat2 ;
    cat1.eat();
    cat2.eat();//propety2.html:21 Uncaught TypeError: Cannot read property 'eat' of undefined
</script>
</body>
</html>